<!DOCTYPE html>
<html>    
<head>
    
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title></title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico"> 
    <link href="../css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="../css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="../css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="../css/plugins/chosen/chosen.css" rel="stylesheet">
    <link href="../css/plugins/colorpicker/css/bootstrap-colorpicker.min.css" rel="stylesheet">
    <link href="../css/plugins/cropper/cropper.min.css" rel="stylesheet">
    <link href="../css/plugins/switchery/switchery.css" rel="stylesheet">
    <link href="../css/plugins/jasny/jasny-bootstrap.min.css" rel="stylesheet">
    <link href="../css/plugins/nouslider/jquery.nouislider.css" rel="stylesheet">
    <link href="../css/plugins/datapicker/datepicker3.css" rel="stylesheet">
    <link href="../css/plugins/ionRangeSlider/ion.rangeSlider.css" rel="stylesheet">
    <link href="../css/plugins/ionRangeSlider/ion.rangeSlider.skinFlat.css" rel="stylesheet">
    <link href="../css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">
    <link href="../css/plugins/clockpicker/clockpicker.css" rel="stylesheet">
    <link href="../css/animate.css" rel="stylesheet">
    <link href="../css/style.css?v=4.1.0" rel="stylesheet">
    <link rel="stylesheet" href="../css/plugins/plyr/plyr.css">
    <link href="../css/plugins/jsTree/style.min.css" rel="stylesheet">
    <link rel="stylesheet" href="../css/plugins/plyr/plyr.css">

</head>
<body class="gray-bg">
<div class="row wrapper wrapper-content animated fadeInRight">
<div class="row">
#for(x:moduleView)
    #if(x.style==1)
    <div class="col-sm-1">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>#(x.title)</h5>
                <div class="ibox-tools">
                    <a class="collapse-link">
                        <i class="fa fa-chevron-up"></i>
                    </a>
                    <a class="dropdown-toggle" data-toggle="dropdown" href="form_advanced.html#">
                        <i class="fa fa-wrench"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                    </ul>
                    <a class="close-link">
                        <i class="fa fa-times"></i>
                    </a>
                </div>
            </div>
            <div class="ibox-content" onclick="IO_onClick('#(x.id)','#(x.title)')">
                <input id="#(x.title)" type="checkbox" class="js-switch" />    
            </div>
        </div>
    </div>
    #end
    #if(x.style==2)
    <div class="col-sm-2">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>#(x.title)</h5>
                <div class="ibox-tools">
                    <a class="collapse-link">
                        <i class="fa fa-chevron-up"></i>
                    </a>
                    <a class="dropdown-toggle" data-toggle="dropdown" href="form_advanced.html#">
                        <i class="fa fa-wrench"></i>
                    </a>
                    <a class="close-link">
                        <i class="fa fa-times"></i>
                    </a>
                </div>
            </div>
            <div class="ibox-content">
                <div class="m-r-md inline" onclick="Sld_onClick('#(x.id)','#(x.title)')">
                    <input type="text" id="#(x.title)" value="0" class="dial knob" data-fgColor="#1AB394" data-width="85" data-height="85" />
               </div>             
            </div>
        </div>
    </div>
    #end
    #if(x.style==3)
    <div class="col-sm-2">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>#(x.title)</h5>
                <div class="ibox-tools">
                    <a class="collapse-link">
                        <i class="fa fa-chevron-up"></i>
                    </a>
                    <a class="dropdown-toggle" data-toggle="dropdown" href="form_advanced.html#">
                        <i class="fa fa-wrench"></i>
                    </a>
                    <a class="close-link">
                        <i class="fa fa-times"></i>
                    </a>
                </div>
            </div>
            <div class="ibox-content">
                <div class="m-r-md inline">
                     <button type="button" class="btn btn-primary btn-lg" id="#(x.title)" onClick="Btn_onClick('#(x.id)','#(x.title)')">随时可以猛击</button>
               </div>             
            </div>
        </div>
    </div>
    #end
    #if(x.style==4)
    <div class="col-sm-3">
        <div class="ibox">
            <div class="ibox-title">
                <h5>#(x.title)</h5>
                <div class="ibox-tools">
                    <a class="collapse-link">
                        <i class="fa fa-chevron-up"></i>
                    </a>
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-wrench"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li><a href="#">选项 01</a>
                        </li>
                        <li><a href="#">选项 02</a>
                        </li>
                    </ul>
                    <a class="close-link">
                        <i class="fa fa-times"></i>
                    </a>
                </div>
            </div>
            <div class="ibox-content">
                <h3>
                    定时间隔
                </h3>

                <div class="input-group clockpicker" data-autoclose="true" onclick="Sld_onClick('#(x.id)','#(x.title)')">
                    <input type="text" class="form-control" value="00:00" id="#(x.title)">
                    <span class="input-group-addon">
                            <span class="fa fa-clock-o" ></span>
                    </span>
                </div>
                <div class="radio radio-info radio-inline">
                    <input type="radio" id="inlineRadio1" value="option1" name="radioInline" checked="">
                    <label for="inlineRadio1"> 定时模式 </label>
                </div>
                <div class="radio radio-inline">
                    <input type="radio" id="inlineRadio2" value="option2" name="radioInline">
                    <label for="inlineRadio2"> 延时模式 </label>
                </div>
            </div>
        </div>
    </div>
    #end
    #if(x.style==5)
    <div class="col-sm-4">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>#(x.title)</h5>
                <div class="ibox-tools">
                    <a class="collapse-link">
                        <i class="fa fa-chevron-up"></i>
                    </a>
                    <a class="dropdown-toggle" data-toggle="dropdown" href="form_basic.html#">
                        <i class="fa fa-wrench"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li><a href="form_basic.html#">选项1</a>
                        </li>
                        <li><a href="form_basic.html#">选项2</a>
                        </li>
                    </ul>
                    <a class="close-link">
                        <i class="fa fa-times"></i>
                    </a>
                </div>
            </div>
            #if(x.type==8)
            <video width="320" height="240" controls>
              <source src="movie.mp4" type="video/mp4">
              <source src="movie.ogg" type="video/ogg">
              <source src="movie.webm" type="video/webm">
                您的浏览器不支持 video 标签。
            </video> 
            #elseif(x.type==7)
            <div class="ibox-content">
                <div class="player">
                    <audio controls>
                        <!-- Audio files -->
                        <source src="" type="audio/mp3" id="#(x.title)">

                        <!-- Fallback for browsers that don't support the <audio> element -->
                        您的浏览器不支持在线播放
                    </audio>
                </div>
            </div>
            #elseif(x.type==9)
            <div class="ibox-content">
                <div class="player">
                    <button class="btn btn-danger btn-circle" type="button" id="#(x.title)stop"  onclick="Ply_onClick('#(x.id)','#(x.title)stop',0)"><i class="fa fa-stop"></i>
                    </button>
                    <button class="btn btn-info btn-circle " style=" margin-left: 30px;margin-right: 5px;" type="button"  id="#(x.title)backward"><i class="fa fa-backward" onclick="Ply_onClick('#(x.id)','#(x.title)',1)"></i>
                    </button>
                    <div class="btn-group" data-toggle="buttons" style=" margin-left: 5px;">
                        <label class="btn btn-primary btn-success btn-circle btn-lg btn-outline" onclick="Ply_onClick('#(x.id)','#(x.title)play',2)" id="#(x.title)playbtn">
                            <input type="checkbox"  id="#(x.title)play"> <i class="fa fa-play"></i>
                        </label>
                    </div>
                    <button class="btn btn-info btn-circle" style=" margin-left: 5px;" type="button"  id="#(x.title)forward" onclick="Ply_onClick('#(x.id)','#(x.title)forward',3)"><i class="fa fa-forward"></i>
                    </button>

                    <input type="text" hidden="true" id="#(x.title)radios" value="1"></input>
                    <div class="btn-group" data-toggle="buttons" style=" margin-left: 30px;"  onclick="Ply_onClick('#(x.id)','#(x.title)radios',4)" value="1">                        
                        <label class="btn btn-primary btn-circle btn-primary btn-outline active" id="#(x.title)opt1">
                            <input type="radio" name="options"  checked> <i class="fa fa-repeat"></i>
                        </label>
                        <label class="btn btn-primary btn-circle btn-primary btn-outline" style=" margin-left: 7px;" id="#(x.title)opt2">
                            <input type="radio" name="options"  > <i class="fa fa-list"></i>
                        </label>
                        <label class="btn btn-primary btn-circle btn-primary btn-outline" style=" margin-left: 7px;"  id="#(x.title)opt3">
                            <input type="radio" name="options" > <i class="fa fa-random"></i>
                        </label>
                    </div>

                    <button class="btn btn-info btn-circle" style=" margin-left: 30px;" type="button"><i class="fa fa-volume-down"  id="#(x.title)voldown" onclick="Ply_onClick('#(x.id)','#(x.title)voldown',5)"></i>
                    </button>

                    <button class="btn btn-info btn-circle" style=" margin-left: 7px;" type="button"  id="#(x.title)volup"onclick="Ply_onClick('#(x.id)','#(x.title)volup',6)"><i class="fa fa-volume-up"></i>
                    </button>
                    
                </div>
            </div>
            #end
        </div>
    </div>
    #end
    #if(x.style==6)
    <div class="col-sm-6">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>#(x.title)</h5>
                <div class="ibox-tools">
                    <a class="collapse-link">
                        <i class="fa fa-chevron-up"></i>
                    </a>
                    <a class="dropdown-toggle" data-toggle="dropdown" >
                        <i class="fa fa-wrench"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                    </ul>
                    <a class="close-link">
                        <i class="fa fa-times"></i>
                    </a>
                </div>
            </div>
            <div class="ibox-content">
                <div class="flot-chart">
                    <div class="flot-chart-content" id="#(x.title)"></div>
                </div>
            </div>
        </div>
    </div>
    #end
    #if(x.style==7)
    <div class="col-sm-6">
        <div class="ibox">
            <div class="ibox-title">
                <h5>#(x.title)</h5>
                <div class="ibox-tools">
                    <a class="collapse-link">
                        <i class="fa fa-chevron-up"></i>
                    </a>
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-wrench"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li><a href="#">选项 01</a>
                        </li>
                        <li><a href="#">选项 02</a>
                        </li>
                    </ul>
                    <a class="close-link">
                        <i class="fa fa-times"></i>
                    </a>
                </div>
            </div>
            <div class="ibox-content">
                <div class="chat-discussion" id="#(x.title)box">
                    
                </div>

                <div class="chat-message-form">
                     <div class="form-group">
                        <textarea class="form-control message-input" name="message" id="#(x.title)" placeholder="输入消息内容，点击发送" ></textarea>
                        <br/>
                         <button type="button" class="btn btn-primary btn-rounded btn-block" onclick="Tlk_onClick('#(x.id)' , '#(x.title)')">发送</button>
                     </div>
                 </div>
            </div>
        </div>
    </div>
    #end
#end   
</div>
</div>
    <!-- 全局js -->
    <script src="../js/jquery.min.js?v=2.1.4"></script>
    <script src="../js/bootstrap.min.js?v=3.3.6"></script>

    <!-- 自定义js -->
    <script src="../js/content.js?v=1.0.0"></script>

    <!-- Chosen -->
    <script src="../js/plugins/chosen/chosen.jquery.js"></script>

    <!-- JSKnob -->
    <script src="../js/plugins/jsKnob/jquery.knob.js"></script>

    <!-- Input Mask-->
    <script src="../js/plugins/jasny/jasny-bootstrap.min.js"></script>

    <!-- Data picker -->
    <script src="../js/plugins/datapicker/bootstrap-datepicker.js"></script>

    <!-- Prettyfile -->
    <script src="../js/plugins/prettyfile/bootstrap-prettyfile.js"></script>

    <!-- NouSlider -->
    <script src="../js/plugins/nouslider/jquery.nouislider.min.js"></script>

    <!-- Switchery -->
    <script src="../js/plugins/switchery/switchery.js"></script>

    <!-- IonRangeSlider -->
    <script src="../js/plugins/ionRangeSlider/ion.rangeSlider.min.js"></script>

    <!-- iCheck -->
    <script src="../js/plugins/iCheck/icheck.min.js"></script>

    <!-- MENU -->
    <script src="../js/plugins/metisMenu/jquery.metisMenu.js"></script>

    <!-- Color picker -->
    <script src="../js/plugins/colorpicker/bootstrap-colorpicker.min.js"></script>

    <!-- Clock picker -->
    <script src="../js/plugins/clockpicker/clockpicker.js"></script>

    <!-- Flot -->
    <script src="../js/plugins/flot/jquery.flot.js"></script>
    <script src="../js/plugins/flot/jquery.flot.tooltip.min.js"></script>
    <script src="../js/plugins/flot/jquery.flot.resize.js"></script>
    <script src="../js/plugins/flot/jquery.flot.pie.js"></script>

     <!-- Flot demo data -->
    <script src="../js/demo/flot-demo.js"></script>

    <!-- Plyr core script -->
    <script src="../js/plugins/plyr/plyr.js"></script>

    <script src="../js/bootbox.min.js"></script>


    <!-- Image cropper -->
    <script src="../js/plugins/cropper/cropper.min.js"></script>

    <script src="../js/demo/form-advanced-demo.js"></script>

        <!-- Plyr core script -->
    <script src="../js/plugins/plyr/plyr.js"></script>

<script>
    function playerConfig(d, u) {
        var a = new XMLHttpRequest(),
            b = d.body;

        // Check for CORS support
        // If you're loading from same domain, you can remove the if statement
        if ("withCredentials" in a) {
            a.open("GET", u, true);
            a.send();
            a.onload = function () {
                var c = d.createElement("div");
                c.setAttribute("hidden", "");
                c.innerHTML = a.responseText;
                b.insertBefore(c, b.childNodes[0]);
            }
        }
    }
    plyr.setup();
        

    function setSwitchery(switchElement, checkedBool) {
        //alert(switchElement.isChecked());
        if ((checkedBool && !switchElement.isChecked()) || (!checkedBool && switchElement.isChecked())) {
            switchElement.setPosition(true);
            switchElement.handleOnchange(true);
            //alert('setSwitchery');
        }
    }

    function proBarRead(id,title){
        var active = "只读";
        var data = document.getElementById(title).value;
        $.ajax({
            url: "/desktop/sldEvent",
            data:{"id":id,"title":title,"data":data,"active":active},
            type: "post",
            success:function(data)
            {
                if(data =="error")
                {
                    msg_show('操作失败');
                }
                else
                {
                    msg_show('操作成功');
                }
            },
            error:function()
            {
                msg_show('请求出错');
            }
        });
    }

    function flotRead(id,title){
        var active = "获得";
        var data = 10;
        $.ajax({
            url: "/desktop/chtEvent",
            data:{"id":id,"title":title,"data":data,"active":active},
            type: "post",
            success:function(data)
            {
                if(data =="error")
                {
                    msg_show('操作失败');
                }
                else
                {
                    msg_show('操作成功');
                }
            },
            error:function()
            {
                msg_show('请求出错');
            }
        });
    }

    var flotOptions={
            grid: {
                color: "#999999",
                tickColor: "#D4D4D4",
                borderWidth:0,
                minBorderMargin: 20,
                labelMargin: 10,
                backgroundColor: {
                    colors: ["#ffffff", "#ffffff"]
                },
                margin: {
                    top: 8,
                    bottom: 20,
                    left: 20
                },
                markings: function(axes) {
                    var markings = [];
                    var xaxis = axes.xaxis;
                    for (var x = Math.floor(xaxis.min); x < xaxis.max; x += xaxis.tickSize * 2) {
                        markings.push({
                            xaxis: {
                                from: x,
                                to: x + xaxis.tickSize
                            },
                            color: "#fff"
                        });
                    }
                    return markings;
                }
            },
            colors: ["#1ab394"],
            xaxis: {
                tickFormatter: function() {
                    return "";
                }
            },
            yaxis: {
                min: 0,
                max: 110
            },
            legend: {
                show: true
            }
        };


    function setFlot(title,res){

        var container = $(title);
        // Determine how many data points to keep based on the placeholder's initial size;
        // this gives us a nice high-res plot while avoiding more than one point per pixel.

        series = [{
            data:res,
            lines: {
                fill: true
            }
        }];


        var plot = $.plot(container,series, flotOptions);
        //alert(res);
        // Update the random dataset at 25FPS for a smoothly-animating chart
       

        plot.setData(res);
        //plot.draw();

    }

    function talkRead(path){  //其实是清除json
        $.ajax({
            url:"/desktop/tlkClean",
            data:{"path":path},
            type:"get",
            success:function(data)
            {
                if(data!='ok'){
                    msg_show('清除错误');
                }
            },
            error:function()
            {
                msg_show('清除');
            }
        });
    }


    function reload(sty,title,data,element){
        if(sty=="1"){
            //switchElement.checked = data.checked;
            setSwitchery(element,data.checked);
        }else if(sty=="2"){
            var element = "#"+title;
            $(element).val(data.val).trigger('change');
            //document.getElementById(title).value = data.value;
        }else if(sty=="4"){

        }else if(sty=="5"){
            if(element=="7"){
                //alert(data.path);
                playerConfig(document, "../css/plugins/plyr/sprite.svg");
                document.getElementById(title).src=data.path;
            }else{
                var btnId = "#"+title+"playbtn";
                var playState=document.getElementById((title+"play")).checked;
                if( playState!=data.play){                  
                    $(btnId).button('toggle');
                    document.getElementById((title+"play")).checked = data.play;
                }
                //alert(document.getElementById(title+"radios").value);
                if(data.radio!=document.getElementById(title+"radios").value){
                    var optOld = "#"+title+"opt"+(document.getElementById(title+"radios").value);
                    var opt = "#"+title+"opt"+data.radio;
                    
                    //$(optOld).button('toggle');
                    $(opt).button('toggle');
                    //document.getElementById(title+"opt"+data.radios).checked=true;
                }
            
            }            
        }else if(sty=="7"){
            var htmlStr = '#'+title+"box";
            var mesHtml = "<div class='chat-message'>\
                            <img class='message-avatarL' src='../img/ai.png' alt=''>\
                            <div class='messageL' >\
                                <a class='message-author' href='#'> 颜文字君</a>\
                                <span class='message-dateL' style='float:right'>"+
                                 data.time +"</span>\
                                <span class='message-content' >"+
                                data.content
                                +"</span>\
                            </div>\
                          </div>";
            $(htmlStr).append(mesHtml);
            talkRead(element);
        }else if(sty=="6"){

            setFlot("#"+title,data.res);
        }
    }

    
</script>




#for(x:moduleView)
#if(x.style!=3)
<script>
    $(window).load(function(){
        #if(x.style==7)
            var i=7;
        #else
            getJson#(x.title)();
        #end
        
        #if((x.style==2)&&(x.type==3))
            proBarRead(#(x.id),"#(x.title)");
        #elseif(x.style==6)
            flotRead(#(x.id),"#(x.title)");
        #end
    });

    #if(x.type!=7 && x.type!=8)
    var int=self.setInterval("getJson#(x.title)()",500#(x.id));
    #end

    function getJson#(x.title)(){
        
        var path ="#(requestPath.toString())"+"#(x.title.toString())"+".json";

        $.ajax({
            #if(x.type==7 || x.type==8)
            url:"/desktop/plyPath",
            data:{"id":"#(x.path)"},
            #else
            url:path,
            #end
            type:"get",
            success:function(data)
            {
                //alert(data);
                var data = eval("(" + data + ")"); 
                #if(x.style==1)
                    reload("#(x.style)","#(x.title)",data,sw#(x.title));
                #elseif(x.style==7)
                    if(data.content!="null"){
                        reload("#(x.style)","#(x.title)",data,path);
                    }
                #else
                    reload("#(x.style)","#(x.title)",data,"#(x.type)");
                #end             

            },
            error:function()
            {
                msg_show('#(x.title)请求出错');
            }
        });
        
    }

   
        //代码
    #if(x.style==1)
        var elem = document.querySelector('##(x.title)');
        var sw#(x.title) = new Switchery(elem, {
            color: '#1AB394'
        });
    #end

</script>
#end
#end

<script type="text/javascript">
    function msg_show(txt)
    {
        bootbox.alert(txt);
    }

    function IO_onClick(id,title){
        var data = document.getElementById(title).checked;
        var active = "null";
        if(data){
            active = "打开";
        }else{
            active = "关闭";
        }
        $.ajax({
            url: "/desktop/ioEvent",
            data:{"id":id,"title":title,"data":data,"active":active},
            type: "post",
            success:function(data)
            {
                if(data =="error")
                {
                    msg_show('操作失败');
                }
                else
                {
                    msg_show('操作成功');
                }
            },
            error:function()
            {
                msg_show('请求出错');
            }
        });
    }
    function Sld_onClick(id,title){
        var data = document.getElementById(title).value;
        var active = "拖动";
        $.ajax({
            url: "/desktop/sldEvent",
            data:{"id":id,"title":title,"data":data,"active":active},
            type: "post",
            success:function(data)
            {
                if(data =="error")
                {
                    msg_show('操作失败');
                }
                else
                {
                    msg_show('操作成功');
                }
            },
            error:function()
            {
                msg_show('请求出错');
            }
        });
    }
    function Btn_onClick(id,title){
        var titleStr = '#'+title;
        var data = 0;
        var active = "点击";
        $.ajax({
            url: "/desktop/btnEvent",
            data:{"id":id,"title":titleStr,"data":data,"active":active},
            type: "post",
            success:function(data)
            {
                if(data =="error")
                {
                    msg_show('操作失败');
                }
                else
                {
                    //msg_show('');
                }
            },
            error:function()
            {
                msg_show('请求出错');
            }
        });
    }
    function Tim_onClick(id,title){
        var titleStr = '#'+title;
        var data = $('inlineRadio1').checked;
        var active = "null";
        if(data){
            active = "定时";
        }else{
            active = "延时";
        }
        $.ajax({
            url: "/desktop/timEvent",
            data:{"id":id,"title":titleStr,"data":data,"active":active},
            type: "post",
            success:function(data)
            {
                if(data =="error")
                {
                    msg_show('操作失败');
                }
                else
                {
                    //msg_show('');
                }
            },
            error:function()
            {
                msg_show('请求出错');
            }
        });
    }
    function Ply_onClick(id,title,num){
        var titleStr = '#'+title;
        var data = num*10;
        var active = "null";
        if(num==0){
            active = "停止";
        }else if(num==1){
            active = "上一首";
        }else if(num==2){
            if(document.getElementById(title).checked==false){
                active = "播放";data=21;
            }else{
                active = "暂停";data=22;
            }            
        }else if(num==3){
            active = "下一首";
        }else if(num==4){

            var radio = document.getElementById(title).value;

            if(radio=="1"){
                active="循环播放";
                data+=41;
            }else if(radio=="2"){
                active="列表播放";data+=42;
            }else if(radio=="3"){
                active="随机播放";data+=43;
            }

        }else if(num==5){
            active = "音量减";
        }else if(num==6){
            active = "音量加";
        }


        else{
            active = "关闭";
        }
        $.ajax({
            url: "/desktop/plyEvent",
            data:{"id":id,"title":title,"data":data,"active":active},
            type: "post",
            success:function(data)
            {
                if(data =="error")
                {
                    msg_show('操作失败');
                }
                else
                {
                    //msg_show('');
                }
            },
            error:function()
            {
                msg_show('请求出错');
            }
        });
    }
    function Cht_onClick(id,title){
        var titleStr = '#'+title;
        var data = $('titleStr').checked;
        var active = "null";
        if(data){
            active = "打开";
        }else{
            active = "关闭";
        }
        $.ajax({
            url: "/desktop/chtEvent",
            data:{"id":id,"title":titleStr,"data":data,"active":active},
            type: "post",
            success:function(data)
            {
                if(data =="error")
                {
                    msg_show('操作失败');
                }
                else
                {
                    //msg_show('');
                }
            },
            error:function()
            {
                msg_show('请求出错');
            }
        });
    }
    function Tlk_onClick(id,title){
        var htmlStr = '#'+title+"box";
        var data =  document.getElementById(title).value;
        var date =  new Date();   
        var mesHtml = "<div class='chat-message'>\
                            <img class='message-avatarR' src='../img/man.png' alt=''>\
                            <div class='messageR'>\
                                <a class='message-author' > 用户</a>\
                                <span class='message-dateR' >"+
                                 date.toLocaleString() +"</span>\
                                <span class='message-content'>"+
                                data +"</span>\
                            </div>\
                          </div>";
        $(htmlStr).append(mesHtml);
        active = "发送";
        $.ajax({
            url: "/desktop/tlkEvent",
            data:{"id":id,"title":title,"data":data,"active":active},
            type: "post",
            success:function(data)
            {
                if(data =="error")
                {
                    msg_show('操作失败');
                }
                else
                {
                    //msg_show('');
                }
            },
            error:function()
            {
                msg_show('请求出错');
            }
        });
    }
</script>

</body>
</html>